package com.feign.comsumer.feigncomsumer.service;

import com.feign.comsumer.feigncomsumer.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @ClassName: HelloService
 * @Description: TODO
 * @Author WN
 * @Date 2021/7/16 11:02
 * @Version V1.0
 */
@FeignClient(value = "HELLO-SERVICE")
@Service
public interface HelloService {
    @RequestMapping("/hello")
    String hello();
    @RequestMapping(value = "/hello1",method = RequestMethod.GET)
    String hello(@RequestParam("name") String name);
    @RequestMapping(value = "/hello2",method = RequestMethod.GET)
    User hello(@RequestHeader("name") String name, @RequestHeader("age") Integer age);
    @RequestMapping(value = "/hello3",method = RequestMethod.POST)
    String hello(@RequestBody User user);

}
